import React, { useState } from 'react'
import { Navigate } from 'react-router-dom'

export default function Home() {
  const [count, setCount] = useState(0)
  return (
    <div>
      {/* 默认replace=false, 即push模式 */}
      {count===10 ? <Navigate to="/about" replace={false}/> : <p>count:{count}</p> }
      <button onClick={()=>setCount(count+1)}>点我+1</button>
    </div>
  )
}
